﻿Public Class clsRefueling
    Implements ICloneable

    Private m_pDate As Date
    Private m_dPrice As Single
    Private m_dLiter As Single
    Private m_dPricePerLiter As Single
    Private m_sGasStation As String

    Private m_dLastDistance As Single


#Region " Properties "
    Public Property RefuelDate As Date
        Get
            Return m_pDate
        End Get
        Set(ByVal value As Date)
            m_pDate = value
        End Set
    End Property
    Public Property Price As Single
        Get
            Return m_dPrice
        End Get
        Set(ByVal value As Single)
            m_dPrice = value
        End Set
    End Property
    Public Property Liter As Single
        Get
            Return m_dLiter
        End Get
        Set(ByVal value As Single)
            m_dLiter = value
        End Set
    End Property
    Public Property PricePerLiter As Single
        Get
            Return m_dPricePerLiter
        End Get
        Set(ByVal value As Single)
            m_dPricePerLiter = value
        End Set
    End Property
    Public Property GasStation As String
        Get
            Return m_sGasStation
        End Get
        Set(ByVal value As String)
            m_sGasStation = value
        End Set
    End Property

    Public Property LastDistance As Single
        Get
            Return m_dLastDistance
        End Get
        Set(ByVal value As Single)
            m_dLastDistance = value
        End Set
    End Property
#End Region

    Public Sub AdoptValues(ByVal pEntry As clsRefueling)
        With pEntry
            Me.m_dLastDistance = pEntry.LastDistance
            Me.m_dLiter = pEntry.m_dLiter
            Me.m_dPrice = pEntry.m_dPrice
            Me.m_dPricePerLiter = pEntry.m_dPricePerLiter
            Me.m_pDate = pEntry.m_pDate
            Me.m_sGasStation = pEntry.m_sGasStation
        End With
    End Sub

    Public Function Clone() As Object Implements System.ICloneable.Clone
        Dim pClone As New clsRefueling

        With pClone
            .m_dLastDistance = Me.m_dLastDistance
            .m_dLiter = Me.m_dLiter
            .m_dPrice = Me.m_dPrice
            .m_dPricePerLiter = Me.m_dPricePerLiter
            .m_pDate = Me.m_pDate
            .m_sGasStation = Me.m_sGasStation
        End With

        Return pClone
    End Function
End Class
